package com.tbit.main.service.ter;

import com.tbit.main.pojo.Machine;
import lombok.Data;

/**
 * 终端控制结果
 *
 *
 * @author <a href="mailto:chen.chaoxiong@tbit.com.cn">ChenChaoXiong</a>
 * @since 2024/8/6
 */
@Data
public class TerControlResult {

    private Machine machine;


    private TerControlFailType failReason;


    public static TerControlResult fail(Machine machine, TerControlFailType failReason) {
        TerControlResult result = new TerControlResult();
        result.setMachine(machine);
        result.setFailReason(failReason);
        return result;
    }

    public static TerControlResult success(Machine machine) {
        TerControlResult result = new TerControlResult();
        result.setMachine(machine);
        return result;
    }

    public boolean isSuccess() {
        return failReason == null;
    }

}
